package com.erpanderp.pr.model.entity

import com.erpanderp.pr.util.Constants

class PurchaseRequestTransactionView {
	static belongsTo=[purchaseRequest:PurchaseRequest]

	String purchaseRequestCode
	String sapPrNumber
	String documentType

	Integer itemNumber	
	String accountAssignmentCategory	
	String itemCategory	
	String material	
	String shortText	
	double quantity	
	String unit	
	Date deliveryDate	
	String materialGroup	
	String plant	
	String storageLocation	
	String purchasingGroup	
	String desiredVendor

	String glAccount	
	String costCenter	
	String orderDetail	
	String network	

	String transactionStatus=Constants.TRANSACTION_STATUS_IN_PROCESS
	
	String description
	Date dateCreated
	Date lastUpdated
	String createdBy
	String lastUpdatedBy

    static constraints = {
    	purchaseRequestCode(maxSize:50)
    	sapPrNumber(nullable:true, maxSize: 255)
    	documentType(maxSize: 4)

    	itemNumber()
    	accountAssignmentCategory(maxSize: 1)
    	itemCategory(maxSize: 1)
    	material(maxSize: 18)
    	shortText(maxSize: 40)
    	quantity(scale: 3)
    	unit(maxSize: 3)
    	materialGroup(maxSize: 3)
    	plant(maxSize: 4)
    	storageLocation(maxSize: 4)
    	purchasingGroup(maxSize: 3)
    	desiredVendor(maxSize: 10)

    	glAccount(maxSize: 10)
    	costCenter(maxSize: 10)
    	orderDetail(maxSize: 10)
    	network(maxSize: 12)
    	
    	transactionStatus(inList:Constants.purchaseRequestTransactionStatusList)

    	createdBy(maxSize: 255)
    	lastUpdatedBy(maxSize: 255)
    }
}
